<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="/css/start/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="/js/jquery.leanModal.min.js"></script>
<title>Payroll HQ</title>
<link type="text/css" href="/css/start/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
<style type="text/css">
/* <![CDATA[ */

table, td
{
    border-color: #666;
    border-style: solid;
}
table, th
{
    border-color: #666;
    border-style: solid;
}

table
{
    border-width: 0 0 1px 1px;
    border-spacing: 0;
    border-collapse: collapse;
}
 
td
{
    margin: 0;
    padding: 4px;
    border-width: 1px 1px 0 0;
}
th
{
    margin: 0;
    padding: 4px;
    border-width: 1px 1px 0 0;
}

/* ]]> */
</style>

<style type="text/css">
.noborder{
	border-top-width:0px;
	border-bottom-width:0px;
	
	}
.withborder{
	border-top-width:1px;
	border-bottom-width:0px;
	}	
#lean_overlay {
    position: fixed;
    z-index:100;
    top: 0px;
    left: 0px;
    height:100%;
    width:100%;
    background: #000;
    display: none;
} 

.btn_act{

    width: 600px;
    padding-bottom: 2px; 
	display:none;
	background: #FFF;
    border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
    box-shadow: 0px 0px 4px rgba(0,0,0,0.7); -webkit-box-shadow: 0 0 4px rgba(0,0,0,0.7); -moz-box-shadow: 0 0px 4px rgba(0,0,0,0.7);      
}
.btn_edit{

    width: 900px;
    padding-bottom: 2px;
    padding-left:10px; 
	display:none;
	background: #FFF;
    border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
    box-shadow: 0px 0px 4px rgba(0,0,0,0.7); -webkit-box-shadow: 0 0 4px rgba(0,0,0,0.7); -moz-box-shadow: 0 0px 4px rgba(0,0,0,0.7);      
}
.btn_com{

    width: 600px;
    padding-bottom: 2px; 
	display:none;
	background: #FFF;
    border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
    box-shadow: 0px 0px 4px rgba(0,0,0,0.7); -webkit-box-shadow: 0 0 4px rgba(0,0,0,0.7); -moz-box-shadow: 0 0px 4px rgba(0,0,0,0.7);      
}
.btn_delete{

    width: 600px;
    padding-bottom: 2px; 
	display:none;
	background: #FFF;
    border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
    box-shadow: 0px 0px 4px rgba(0,0,0,0.7); -webkit-box-shadow: 0 0 4px rgba(0,0,0,0.7); -moz-box-shadow: 0 0px 4px rgba(0,0,0,0.7);      
}
#payrollWizard{
	position:relative;
	top:5px;
    left:85%;
}
html, body {
height: 100%;
width: 100%;
}
.white_content {
display: none;
position: absolute;
top: 25%;
left: 25%;
width: 50%;
padding:10px;

border: 8px solid blue;
z-index:1002;
}
.black_overlay {
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color:#f5f5f5;
z-index:1001;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=80);
}
.close {
float:right;
clear:both;
width:100%;
text-align:right;
margin:0 0 6px 0
}
.close a {
color:#333;
text-decoration:none;
font-size:14px;
font-weight:700
}
.con {
text-indent:20px;
line-height:10px;
}
</style>
<script type="text/javascript">
	$(function() {
		$( "#date_begin" ).datepicker({ dateFormat: "yy-mm-dd",firstDay: 1 });
		$( "#date_end" ).datepicker({ dateFormat: "yy-mm-dd"});
		
	});
</script>
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="/js/jquery.leanModal.min.js"></script>
<script type="text/javascript">
			$(function() {
    			$('a[rel*=leanModal]').leanModal({ top : 200, closeButton: ".modal_close" });		
			});
		</script>
</head>

<body style="font-family:Arial, Helvetica, sans-serif">
<h1>Payroll Wizard Main Page(HQ)</h1>
<a href = "http://<?php echo WEB_IP?>/roster/online-leave-summary" target = "_blank" >Edit Unpaid Annual Leave</a><br/><br/>
<form action = "" method = "post" enctype="multipart/form-data">
	<h2>Select Date Period:</h2>
	Start Date:<input type = "text" name = "date_begin" id = "date_begin" value = "<?php if($this->dateStart){echo $this->dateStart;}?>"></input>
	End Date:<input type = "text" name = "date_end" id = "date_end" value = "<?php if($this->dateEnd){echo $this->dateEnd;}?>"></input>
	<br/>
	<br/>
	<input type = "submit" id = "confirm_roster" name = "confirm_roster" value = "Confirm Roster" onclick="if(confirm('Are you sure to confirm roster?')){} else {return false;};"></input><?php if($this->check){echo "  <span style=\"background:#2FF20D\">".$this->check."</span>";}?>
	<input type = "submit" id = "export_whch" name = "export_whch" value = "Export WHCH"></input>
	<br/>
	<br/>
	
	<input type = "submit" id = "next" name = "next" value = "Next" ></input>
</form>

<?php if($this->attend){
		$staff = new Model_DbTable_Roster_Stafflogindetail();?>
		<h2>Miss login/logout Staff List</h2>
		<?php foreach($this->attend as $k => $v){
		$staffName = $staff->getDetail($k);?>
		<?php echo 'Staff Name:'.$staffName['ni'];?><br/>	
		<table border="1" cellspacing="1" cellpadding="3" style="font-size:13px;">
			<tr>
				<th rowspan="2" scope="col">Date</th>
				<th colspan="2" scope="col">Roster Time</th>
				<th colspan="2" scope="col">Actual Log</th>
			</tr>
			<tr>
				<th>Start</th>
				<th>End</th>
				<th>Start</th>
				<th>End</th>
			</tr>
			<?php foreach ($v as $k2 => $v2){ ?>

				<tr>
				<?php if($v2['shift_begin']!= null && $v2['act_begin'] == null || $v2['shift_end'] != null && $v2['act_end'] == null){?>
				<td><?php echo $k2;?><div id="light<?=$k2?>_<?=$k?>" class="btn_edit">
     <div style=" background-color:#97C0FF; display:block">
			<span style="float:left">Edit</span> <span style="float:right;"><a class="modal_close" href="#">[ X ]</a></span><br />
	 </div>
     <div style="background-color:#EEE; display:block; padding:"><br />
			<form id = "form3" name = "form3" action = "/rosteraudit/wh-fake-attn-record" method = "post" enctype="multipart/form-data"> 
          		<div class="con">
					<input type="hidden" name="staff_id" id="staff_id" value="<?php echo $k;?>" />
					<input type="hidden" name="date_begin" id = "date_begin" value = "<?php echo $this->dateStart?>"></input>
					<input type="hidden" name="date_end" id = "date_end" value = "<?php echo $this->dateEnd?>"></input>
					<?php if(!$v2['act_begin'] && !$v2['act_end']){?>
						 Date:<br/><br/>
   		 				<?php $date=explode('-',$k2);?>
  						<input type="text" name="year" id="year" value="<?php echo $date[0]?>" style="width:50px;" /> 
   			 				-
  						<input type="text" name="month" id="month" value="<?php echo $date[1]?>" style="width:50px;" />
    		 				-
  						<input type="text" name="day" id="day" value="<?php echo $date[2]?>" style="width:50px;" /> 
    					(2013-09-09)<br />
    					On Duty <br/><br/>
    					Time:
  						<input type="hidden" name = "on_status" id = "on_status" value = "1"></input>
  						<input type="text" name="hour" id="hour" value="<?php echo date("H",$v2['shift_begin']);?>" style="width:50px;" /> 
    					:
  						<input type="text" name="min" id="min" value="<?php echo date("i",$v2['shift_begin']);?>" style="width:50px;" /> 
    					(09:08),(17:59)<br /><br/>
  						<br />
  						Off Duty<br/><br/>
    					Time:
  						<input type="hidden" name = "off_status" id = "off_status" value = "1"></input>
  						<input type="text" name="hour2" id="hour2" value="<?php echo date("H",$v2['shift_end']);?>" style="width:50px;" /> 
    					:
  						<input type="text" name="min2" id="min2" value="<?php echo date("i",$v2['shift_end']);?>" style="width:50px;" /> 
    					(09:08),(17:59)<br /><br/>
  						<br />
  						<input type="submit" name="btn_insert" id="btn_insert" value="Accept Record" onclick="if(confirm('Are you sure to confirm this roster?')){} else {return false;};"></input>
					<?php }elseif(!$v2['act_begin']){?>
						 Date:<br/><br/>
   		 				<?php $date=explode('-',$k2);?>
  						<input type="text" name="year" id="year" value="<?php echo $date[0]?>" style="width:50px;" /> 
   			 				-
  						<input type="text" name="month" id="month" value="<?php echo $date[1]?>" style="width:50px;" />
    		 				-
  						<input type="text" name="day" id="day" value="<?php echo $date[2]?>" style="width:50px;" /> 
    					(2013-09-09)<br /><br/>
    					On Duty <br/><br/>
    					Time:
  						<input type="hidden" name = "on_status" id = "on_status" value = "1"></input>
  						<input type="hidden" name = "off_status" id = "off_status" value = "2"></input>
  						<input type="text" name="hour" id="hour" value="<?php echo date("H",$v2['shift_begin']);?>" style="width:50px;" /> 
    					:
  						<input type="text" name="min" id="min" value="<?php echo date("i",$v2['shift_begin']);?>" style="width:50px;" /> 
    					(09:08),(17:59)<br />
  						<br />
						<input type="submit" name="btn_insert" id="btn_insert" value="Accept Record" onclick="if(confirm('Are you sure to confirm this roster?')){} else {return false;};"></input>
					<?php }else{?>
						Date:<br/><br/>
   		 				<?php $date=explode('-',$k2);?>
  						<input type="text" name="year" id="year" value="<?php echo $date[0]?>" style="width:50px;" /> 
   			 				-
  						<input type="text" name="month" id="month" value="<?php echo $date[1]?>" style="width:50px;" />
    		 				-
  						<input type="text" name="day" id="day" value="<?php echo $date[2]?>" style="width:50px;" /> 
    					(2013-09-09)<br /><br/>
  						Off Duty<br/><br/>
    					Time:
  						<input type="hidden" name = "on_status" id = "on_status" value = "2"></input>
  						<input type="hidden" name = "off_status" id = "off_status" value = "1"></input>
  						<input type="text" name="hour2" id="hour2" value="<?php echo date("H",$v2['shift_end']);?>" style="width:50px;" /> 
    					:
  						<input type="text" name="min2" id="min2" value="<?php echo date("i",$v2['shift_end']);?>" style="width:50px;" /> 
    					(09:08),(17:59)<br />
  						<br />
  						<input type="submit" name="btn_insert" id="btn_insert" value="Accept Record" onclick="if(confirm('Are you sure to confirm this roster?')){} else {return false;};"></input>
					<?php }?>
      			</div>
			</form>
	 </div>     
</div></td>
				<?php $str2 = "<a id=\"go\" rel=\"leanModal\" name=\"request\" href=\"#light".$k2."_".$k."\"> Access </a>";?>
				<td><?php echo date("H:i",$v2['shift_begin']);?></td>
				<td><?php echo date("H:i",$v2['shift_end']);?></td>
				<td><?php if($v2['act_begin']){echo date("H:i",$v2['act_begin']);}else{echo $str2;}?></td>
				<td><?php if($v2['act_end']){echo date("H:i",$v2['act_end']);}else{echo $str2;}?></td>
					
			<?php }?>
				</tr>
		<?php }?>
			
		</table>

		<?php }?>
		

		
<?php }?>
<br/>


<div style=" font-size:10px; color:#666;float:right;" >Developer:Leo,Date:2015-02-01,ver:1.01</div>
</body>
</html>
